package com.mytijian.openapi.adapter.alihalt.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mytijian.openapi.adapter.alihalt.dao.McodeOrderRelDAO;
import com.mytijian.openapi.adapter.alihalt.service.AlihaltMcodeOrderRelService;


@Service("alihaltMcodeOrderRelService")
public class AlihaltMcodeOrderRelServiceImpl implements AlihaltMcodeOrderRelService {
	
	@Autowired
	private McodeOrderRelDAO mcodeOrderRelDAO;

	@Override
	public boolean addMcodeOrderRelation(String mcode, String orderNum) {
		if (mcode==null || orderNum==null) {
			return false;
		}
		return mcodeOrderRelDAO.insertMcodeOrderRel(mcode, orderNum) == 1;
	}

	@Override
	public String getOrderNumByMocde(String mcode) {
		if (mcode==null) {
			return null;
		}
		return mcodeOrderRelDAO.getOrderNumByMcode(mcode);
	}

}
